package ${package.Controller};


import org.springframework.web.bind.annotation.RequestMapping;

<#if restControllerStyle>
import org.springframework.web.bind.annotation.RestController;
<#else>
import org.springframework.stereotype.Controller;
</#if>
<#if superControllerClassPackage??>
import ${superControllerClassPackage};
</#if>
import ${package.Entity}.${entity};
import ${package.Service}.${table.serviceName};

/**
 * @ProjectName
 * @ClassName ${table.controllerName}
 * @Author: ${author}
 * @Date: ${date}
 * @Description:
 **/
<#if restControllerStyle>
@RestController
<#else>
@Controller
</#if>
@RequestMapping("<#if package.ModuleName?? && package.ModuleName != "">/${package.ModuleName}</#if>/<#if controllerMappingHyphenStyle??>${controllerMappingHyphen?substring(0, controllerMappingHyphen?lastIndexOf('-'))}<#else>${table.entityPath}</#if>")
<#if kotlin>
class ${table.controllerName}<#if superControllerClass??> : ${superControllerClass}()</#if>
<#else>
<#if superControllerClass??>
public class ${table.controllerName} extends ${superControllerClass} {
<#else>
public class ${table.controllerName} {
</#if>
    <#-- 将mapper的name首字母小写 -->
    <#assign lowerServiceName = table.serviceName?substring(0,1)?lowerCase + table.serviceName?substring(1)>
    <#assign lowerEntityName = entity?substring(0,1)?lowerCase + entity?substring(1)>

    @Resource
    private ${table.serviceName} ${lowerServiceName};

}
</#if>
